/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package homework.demo03;

/**
 *
 * @author Administrator
 */
public class FaxSalary {

    public static double getSalaryAfterFax(double rawSalary) {
        double salary = rawSalary - 2000;
        double fax = 0;
        if (salary >= 100000) {
            fax = salary * 0.45 - 15375;
        } else if (salary >= 80000) {
            fax = salary * 0.4 - 10375;
        } else if (salary >= 60000) {
            fax = salary * 0.35 - 6375;
        } else if (salary >= 40000) {
            fax = salary * 0.30 - 3375;
        } else if (salary >= 20000) {
            fax = salary * 0.25 - 1375;
        } else if (salary >= 5000) {
            fax = salary * 0.20 - 375;
        } else if (salary >= 2000) {
            fax = salary * 0.15 - 125;
        } else if (salary >= 500) {
            fax = salary * 0.10 - 25;
        } else {
            fax = salary * 0.05;
        }
        return rawSalary - fax;
    }

    public static void main(String[] args) {
        double raw = 9000;
        System.out.println(raw + "工资对应的税后工资是" + getSalaryAfterFax(raw));
    }
}
